<!DOCTYPE html>
<html>
{% load static %}

<head>
    <meta charset="utf-8">
    <title>互译系统</title>
    <link rel="stylesheet" type="text/css" href="static/css/style.css">
    <link rel="shortcut icon" href="#">
    
</head>
<body>
    <div class="top">
        <a href="{% url 'reset' %}" target="_self">首页</a>
        <a href="{% url 'aboutus' %}" target="_blank">关于我们</a>
    </div>

    <div class="content">
        <h1 class="avr">博古通今——文言文与现代文互译系统</h1>
    </div>

    <form method="post" action="{% url 'translation' %}">
        <div class="switch">
            <select id="source" name="source_language">
                <option value="0">自动检测</option>
                <option value="1">文言文</option>
                <option value="2">现代文</option>
            </select>
            <select id="target" name="target_language">
                <option value="1">文言文</option>
                <option value="2">现代文</option>
            </select>
            <br/>
        </div>

        
        <div class="text">
            <textarea cols="45" rows="20" id="t1" name="input" placeholder="请输入您要翻译的内容">{{textin}}</textarea>
            <button type ="submit" id="b">翻译</button>
            <textarea cols="45" rows="20" id="t2" name="output" placeholder="翻译结果">{{textout}}</textarea>
        </div>
    </form>

    <script type="text/javascript">
        var source_id= '{{source_language}}';
        var target_id= '{{target_language}}';
        document.getElementById('source').value=source_id;
        document.getElementById('target').value=target_id;
    </script>
    
</body>
</html>